/**
 * 认证授权相关类型定义
 * 包含登录、注册、用户信息等类型
 */

/** 登录token的请求参数 */
export interface LoginParams {
  username: string;
  password: string;
  grant_type: string;
  scope: string;
}

/** 登录，获取token和refresh_token的结果 */
export interface LoginResult {
  sub: string;
  clientId: string;
  iss: string;
  token_type: string;
  access_token: string;
  refresh_token: string;
  aud: string[];
  license: string;
  exp: string;
  expires_in: string;
  iat: string;
  jti: string;
  userName: string;
}

/** 定义拥有token和用户信息的整体对象 */
export interface UserTokenInfo {
  access_token?: string;
  refresh_token?: string;
  userName?: string;
  isLogin?: boolean;
  basicAuth?: string;
  avatar?: string;
  phone?: string;
  email?: string;
}

/** 登录后用户信息 */
export interface UserInfoResult {
  nickname: string;
  username: string;
  avatar: string;
  phone: string;
  email: string;
}

/** 用户信息 */
export interface UserInfo {
  userId: string;
  username: string;
  phone: string;
  avatar: string;
  nickname: string;
  name: string;
  email: string;
}

/** 时钟用户信息 */
export interface ClockUserInfo {
  name: string;
  alias: string;
  level: string;
  totalGrade: string;
  avatar: string;
}

/** 注册参数 */
export interface RegisterParams {
  username: string;
  password: string;
  phone: string;
}
/** 头像上传结果 */
export interface AvatarUploadResult {
  bucketName: string; // 存储桶名称
  fileName: string;   // 文件名
  url: string;        // 访问URL
}